﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="JKF.Web.Customer.Customer_Add" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .checkboxList label { margin-right: 16px; }
        .checkboxList input { margin-right: 8px; }
    </style>
    <%= RegScript("~/js/jquery.1.5.js")%>
    <%=RegScript("~/js/Common.js")%>
    <%=RegScript("~/js/jquery.json.js")%>
    <%=RegScript("~/js/jquery.nhis.js")%>
    <%=RegScript("~/js/jquery.rchis.js")%>
    <%=RegScript("~/js/jquery.validate.js")%>
    <%=RegScript("~/js/DatePicker/WdatePicker.js")%>
    <%=RegStyle("~/js/suggest/jquery.suggest.css")%>
    <%=RegScript("~/js/jquery-ui-custom.min.js")%>
    <%=RegScript("~/js/Uppop/tipswindown2.js") %>
    <%=RegStyle("~/App_Themes/Theme2/Include.css")%>
    <script type="text/javascript">
        var appPath = "<%=AppPath %>";
        var isAdd = "<%=NoAddRedirect%>";
        var intSetTimeOutID;
        var areaHandler = appPath + '/do/Dic/Dic_Area.do';
        var curstomerHandler = appPath + '/do/Customer/Customer.do';
        var customerInfo = <%=CustomerInfo%>;
        var customer = (customerInfo == undefined || customerInfo == null) ? null : customerInfo.Customer;
        var memoryDay= (customerInfo == undefined || customerInfo == null) ? null : customerInfo.MemoryDay;
        var disease = (customerInfo == undefined || customerInfo == null) ? null : customerInfo.Disease;
        var tmpl = new DTemplate();
        var chkReCard = false;
        $(function () {
            BindArea();
            BindValidate();
            $("#btnAdd").click(saveCurstomerInfo);
            $("#memAdd").click(AddCustomerDate);
            if(customer) BindData();
        });

        function BindArea() {
            $("#MOBILE").UniqueCode(function(){
                var mobile = $.FxNull($("#MOBILE").val(),"");
                var curKey = (customer == null || customer == undefined) ? "" : customer.CUSTOMER_KEY;
                $.post(curstomerHandler,{ActionName:"MobileExists",mobile:mobile,customerKey:curKey},function (rslt) {
                    if(rslt.Success) {
                        $("#MOBILE").attr("state",rslt.Data?"2":"0");
                        return;
                    }
                    alert(rslt.Message);
                },"json");    
            },false);
            $("#CARD_NO").UniqueCode(function(){
                var cardNo = $.FxNull($("#CARD_NO").val(),"");
                var curKey = (customer == null || customer == undefined) ? "" : customer.CUSTOMER_KEY;
                $.post(curstomerHandler,{ActionName:"CardNoExists",cardNo:cardNo,customerKey:curKey},function (rslt) {
                    if(rslt.Success) {
                        $("#CARD_NO").attr("state",rslt.Data?"2":"0");
                        return;
                    }
                    alert(rslt.Message);
                },"json");    
            },false);
            $("#REFEREE_CARD").blur(function(){
                if(!chkReCard){
                    var cn = $(this);
                    var curVl=$.trim(cn.val());
                    if(curVl!="" && curVl.length==8 && cn.attr("lst")!=curVl) {
                        chkReCard = true;
                        $.post(curstomerHandler,{ActionName:"GetCustomerNameByCard_No",cardNo:curVl},function (rslt) {
                            chkReCard = false;
                            if(rslt.Success){
                                cn.attr("lst",curVl);
                                cn.attr("state","1");
                                var name = $.FxNull(rslt.Data, "");
                                if(name!="") {
                                    $("#REFEREE").val(name);
                                }else {
                                    cn.attr("lst","");
                                    cn.attr("state","");
                                    alert("推荐人卡号"+cn.val()+"不存在.");
                                    cn.val("");
                                }
                                return ;
                            }
                        },"json");
                    }
                }
            });

            $("#ID_CARD").blur(function(){
                var vl=$.trim($("#ID_CARD").val());
                var birth=GetBirthDay(vl);
                //Change the birthday val when id_No is not eq lst value entered
                if(birth!="" && $(this).attr("lst")!=vl){
                    $("#BIRTHDAY").val(birth);
                    $(this).attr("lst",vl);
                }
            });
            
            $("#province").change(function () {
                $("#city").val("");
                $("#AREA_CODE").val("");
                $("#city").attr("disabled", "disabled");
                $("#AREA_CODE").attr("disabled", "disabled");
                if ($(this).val().length > 0) {
                    $.post(areaHandler, { ActionName: "GetAreaJson", code: $(this).val() }, function (obj) {
                        if (obj.Success) {
                            $("#city").empty();
                            $("#city").html("<option value=''>请选择</option>" + tmpl("<option value=\"${value}\">${text}</option>", obj.Data, true)).removeAttr("disabled");
                            if ($("#city").attr("pvl")) {
                                $("#city").val($("#city").attr("pvl")).change();
                            }
                        }
                    }, "json");
                }
            });
            $("#city").change(function () {
                $("#AREA_CODE").val("");
                $("#AREA_CODE").attr("disabled", "disabled");
                if ($(this).val().length > 0) {
                    $.post(areaHandler, { ActionName: "GetAreaJson", code: $(this).val() }, function (obj) {
                        if (obj.Success) {
                            $("#AREA_CODE").empty();
                            $("#AREA_CODE").html("<option value=''>请选择</option>" + tmpl("<option value=\"${value}\">${text}</option>", obj.Data, true)).removeAttr("disabled");
                            if ($("#AREA_CODE").attr("pvl")) $("#AREA_CODE").val($("#AREA_CODE").attr("pvl"));
                        }
                    }, "json");
                }
            });
        }

        function delMem(control){
            if(!confirm("确定要删除该纪念日吗？")) return;
            var ctrl=$(control);
            var pk=$.FxNull(ctrl.attr("pk"),"");
            if(pk!=""){
                //Post to delete
                $.post(curstomerHandler,{ActionName:"RemoveMemo",memKey:pk},function(rslt){
                    if(rslt.Success){
                        ctrl.parent().parent().remove();
                        return;
                    }
                    alert(rslt.Message);
                },"json");
                return;
            }
            ctrl.parent().parent().remove();
        }

        function ClearForm() {
            $(":text").val("");
            $("#province").val("");
            $("select").val("");
            $("#REFEREE_CARD").attr("lst","").attr("state","");
            $("#CARD_NO").attr("state","0");
            $("#MOBILE").attr("state","0");
            $("#memTable>tbody").empty();
            $("#memTable>tbody").append("<tr><td colspan=\"3\">没有数据</td></tr>");
            clearTimeout(intSetTimeOutID);
            $('#resultTipDiv').dialog('close');
        }

        function AddCustomerDate() {
            var obj = {
                Id:"",
                Name:$.trim($("#MEMDAY_NAME").val()),
                Date:$.trim($("#MEMDAY_DATE").val())
            };
            if(obj.Name=="生日") {
                alert("顾客生日不在此录入，请录入顾客其他纪念日.");
                return false;
            }
            if ($("#memTable>tbody").find("td[colspan]").size() > 0) $("#memTable>tbody").empty();
            if(obj.Name.length>0){
                var existsItem = $("#memTable>tbody").find("tr[nm=\"" + obj.Name + "\"]");

                if ($("#memTable>tbody").find("tr[colspan]").size() > 0) {
                    $("#memTable>tbody").empty();
                }
                if(customer==null || customer==undefined){
                    if(existsItem.size()>0) existsItem.remove();
                    $("#memTable>tbody").append($(tmpl("<tr nm=\"${Name}\" dt=\"${Date}\"><td>${Name}</td><td>${Date}</td><td><a href=\"javascript:\" pk=\"\" onclick=\"delMem(this);\">删除</a></td></tr>",obj)));
                    $("#MEMDAY_NAME").val("");
                    $("#MEMDAY_DATE").val("");
                }else {
                    if(existsItem.size()>0) 
                    {
                        //update
                        obj.Id = $.FxNull(existsItem.eq(0).attr("ky"),"");
                        $.post(curstomerHandler,{ActionName:"EditMemDay",customerKey:customer.CUSTOMER_KEY,memDay:$.toJSON(obj)},function (rslt) {
                            if(rslt.Success) {
                                debugger;
                                existsItem.eq(0).attr("nm",rslt.Data.Name).attr("dt",rslt.Data.Date);                    
                                existsItem.eq(0).find("td").eq(0).text(rslt.Data.Name);
                                existsItem.eq(0).find("td").eq(1).text(rslt.Data.Date);
                                $("#MEMDAY_NAME").val("");
                                $("#MEMDAY_DATE").val("");
                            }else {
                                alert(rslt.Message);
                            }
                        },"json");
                    }else {
                        //Add
                        $.post(curstomerHandler,{ActionName:"EditMemDay",customerKey:customer.CUSTOMER_KEY,memDay:$.toJSON(obj)},function (rslt) {
                            if(rslt.Success) {
                                $("#memTable>tbody").append($(tmpl("<tr ky=\"${Id}\" nm=\"${Name}\" dt=\"${Date}\"><td>${Name}</td><td>${Date}</td><td><a href=\"javascript:\" pk=\"${Id}\" onclick=\"delMem(this);\">删除</a></td></tr>",rslt.Data)));            
                                $("#MEMDAY_NAME").val("");
                                $("#MEMDAY_DATE").val("");
                            }else {
                                alert(rslt.Message);
                            }
                        },"json");
                    }
                }
            }else {
                alert("请填写纪念日名称.");
            }
        }

        function BindValidate() {
            alxVr.push({
                id: "CARD_NO",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if(actVal=="") return true;
                    if (actVal.length!=8) {
                        this.msg = "顾客卡号应是8位字符.";
                        return false;
                    }else {
                        var state = $.FxNull(cn.attr("state"), "-1");
                        if(state=="2"){
                            this.msg = "顾客卡号已存在.";
                            return false;
                        }
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "LEVEL_CODE",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if (actVal == "") {
                        this.msg = "请选择顾客级别.";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "NAME",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if (actVal == "") {
                        this.msg = "请输入顾客姓名.";
                        return false;
                    } else if (actVal.length > 25) {
                        this.msg = "顾客姓名应在25个字符之内";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "MOBILE",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if (actVal == "") {
                        return true;
                    } else if (!/^(\+\d{1,4})?1\d{8,11}$/.test(actVal)) {
                        this.msg = "手机号格式不正确.";
                        return false;
                    }
                    else {
                        var state =$.FxNull(cn.attr("state"),"-1");
                        if(state=="2") {
                            this.msg = "手机号已存在.";
                            return false;
                        }
                    }
                    //check exists
                    return true;
                }
            });
            alxVr.push({
                id:"CONSUME_POINTS",
                rule:function (cn) {
                    var vl = $.trim(cn.val());
                    if(/[^\d]/.test(vl)) {
                        this.msg = "请输入消费积分应为大于等于0的数字.";
                        return false;
                    }else if(/\-\d{1,10}/.test(vl)){
                        this.msg = "消费积分应为大于等于0的数字，且长度在10个字符之内.";
                        return false;
                    }else if(!/^\d{1,10}$/.test(vl)) {
                        this.msg = "消费积分应是小于等于10位的整数.";
                        return false;
                    }
                    return true;
                }
            });
            //
            alxVr.push({
                id:"GIVE_POINTS",
                rule:function (cn) {
                    var vl = $.trim(cn.val());
                    if(/[^\d]/.test(vl)) {
                        this.msg = "请输入体验积分应为大于等于0的数字.";
                        return false;
                    }else if(/\-\d{1,10}/.test(vl)){
                        this.msg = "体验积分应为大于等于0的数字，且长度在10个字符之内.";
                        return false;
                    }else if(!/^\d{1,10}$/.test(vl)) {
                        this.msg = "体验积分应是小于等于10位的整数.";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "Phone",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if (actVal.length > 50) {
                        this.msg = "固定电话号码的长度应在50个字符之内.";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "POSTAL_CODE",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if (actVal.length > 0 && !/^\d{5,}$/.test(actVal)) {
                        this.msg = "邮编格式不正确.";
                        return false;
                    }else if (actVal.length > 6) {
                        this.msg = "邮编的长度应在6个字符之内.";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "EMAIL",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if (actVal.length > 0 && !/^[^@]+@[^@]+$/.test(actVal)) {
                        this.msg = "电子邮件格式不正确.";
                        return false;
                    }else if (actVal.length > 100) {
                        this.msg = "电子邮件的长度应在100个字符之内.";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id:"REFEREE_CARD",
                rule:function (cn){
                    var curVl=$.trim(cn.val());
                    if(curVl!="" && curVl.length==8){
                        if(cn.attr("state")=="1"){//success
                            return true;
                        }
                        else if(cn.attr("state")=="0" && curVl!=cn.attr("lst")){
                            cn.blur();
                            return false;
                        }
                        else if(cn.attr("state")=="2"){this.msg="卡号不存在.";return false;}
                    }else if(curVl.length>0){
                        this.msg="顾客卡号格式不正确，应为8为字符.";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "ID_CARD",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if(actVal.length==0) return true;
                    if (!(actVal.length==15 || actVal.length==18)) {
                        this.msg = "身份证的长度应是15位或者18位.";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "TITLE",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if(actVal.length==0) return true;
                    if (actVal.length>50){
                        this.msg = "职业的长度应是50个字符.";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "FAMILY",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if(actVal.length==0) return true;
                    if (actVal.length>500) {
                        this.msg = "家庭情况应在500个字符之内.";
                        return false;
                    }
                    return true;
                }
            });
            alxVr.push({
                id: "MEMO",
                rule: function (cn) {
                    var actVal = $.trim(cn.val());
                    if(actVal.length==0) return true;
                    if (actVal.length>50) {
                        this.msg = "备注应在50个字符之内.";
                        return false;
                    }
                    return true;
                }
            });
            
            $.validateBind();
        }

        function GetBirthDay(idNo){
            if(/^\d{15}$/.test(idNo))
            {
                return "19"+idNo.substr(6,2)+"-"+idNo.substr(8,2)+"-"+idNo.substr(10,2);
            }else if(/^\d{18}$/.test(idNo)){
                return idNo.substr(6,4)+"-"+idNo.substr(10,2)+"-"+idNo.substr(12,2);
            }
            return "";
        }
        
        function saveCurstomerInfo() {
            if($("#MOBILE").attr("state")=="-1"){
                $("#MOBILE").change();
                return;
            }
            if($("#CARD_NO").attr("state")=="-1"){
                $("#CARD_NO").change();
                return;
            }
            if (!$.validateAll()) {
                if ($(".alxv-failed").size() > 0) {
                    $(document).scrollTop($(".alxv-failed").eq(0).scrollTop());
                }
                return;
            };
            var obj = {
                CUSTOMER_KEY:(customer==null || customer==undefined)?"":customer.CUSTOMER_KEY,
                CARD_NO: $.trim($("#CARD_NO").val()),
                LEVEL_CODE: $.trim($("#LEVEL_CODE").val()),
                NAME: $.trim($("#NAME").val()),
                MOBILE: $.trim($("#MOBILE").val()),
                PHONE:$.trim($("#Phone").val()),
                ID_CARD: $.trim($("#ID_CARD").val()),
                SEX: $.trim($("#SEX").val()),
                BIRTHDAY: $.trim($("#BIRTHDAY").val()),
                IS_LUNAR_CALENDAR: $("#IS_LUNAR_CALENDAR").attr("checked") ? "1" : "0",
                REFEREE_CARD: $.trim($("#REFEREE_CARD").val()),
                REFEREE: $.trim($("#REFEREE").val()),
                AREA_CODE: $.trim($("#AREA_CODE").val()),
                ADDRESS: $.trim($("#ADDRESS").val()),
                POSTAL_CODE: $.trim($("#POSTAL_CODE").val()),
                EMAIL: $.trim($("#EMAIL").val()),
                GIVE_POINTS: $.FxNull($.trim($("#GIVE_POINTS").val()),"0"),
                CONSUME_POINTS: $.FxNull($.trim($("#CONSUME_POINTS").val()),"0"),
                GROUP_KEY: $.trim($("#GROUP_KEY").val()),
                PWD: $.trim($("#PWD").val()),
                MEMO: $.trim($("#MEMO").val()),
                DISEASE:[],
                TITLE:$.trim($("#TITLE").val()),
                FAMILY:$.trim($("#FAMILY").val())
                
            };
            $("#DISEASE").find(":checked").each(function() {obj.DISEASE.push({Code:$(this).val(),Name:$(this).attr("nm")});});
            $("#CUSTOMERDISEASE").find(":checked").each(function () {obj.DISEASE.push({code:$(this).val(),name:$(this).attr("nm")});});
            
            var memDates = [];
            if(customer==null || customer==undefined){
                var memDate=$("#memTable>tbody").find("tr");
                $(memDate).each(function () { memDates.push({ Id:"",Name: $.trim($(this).attr("nm")), Date: $.trim($(this).attr("dt")) });});
            }
                
            $.post(curstomerHandler, { ActionName: "EditCustomer", curstomer: $.toJSON(obj),memDates:$.toJSON(memDates),photo_url:$("#FILE_PATH").val()}, function (data) {
                if(data.Success) {
                    top.popRetuInfo(data.Data);
                    if ((customer == null || customer == undefined)) {
                        $.popResultTip('操作成功',[["ClearForm()","继续添加"],["top.tipsWindown.close()","返回列表"]]);
                    } else {
                        $.popResultTip('操作成功',[["top.tipsWindown.close()","返回列表"]]);
                    }
                    //top.tipsWindown.close();
                    return;
                }
                alert(data.Message);
            },"json");
        }

        function BindData() {
            var ob =customer;
            $("#CARD_NO").InitUniqueCode($.FxNull(ob.CARD_NO, ""));
            if ($.FxNull(ob.CARD_NO, "").length > 2) $("#CARD_NO").attr("disabled","disabled");
            $("#LEVEL_CODE").val($.FxNull(ob.LEVEL_CODE, ""));
            $("#NAME").val($.FxNull(ob.NAME, ""));
            $("#MOBILE").InitUniqueCode($.FxNull(ob.MOBILE, ""));
            $("#ID_CARD").val($.FxNull(ob.ID_CARD, ""));
            $("#SEX").val($.FxNull(ob.SEX, ""));
            $("#BIRTHDAY").val((ob.BIRTHDAY!=null && ob.BIRTHDAY!=undefined)?ob.BIRTHDAY.getFullYear()+"-"+(ob.BIRTHDAY.getMonth()+1)+"-"+ob.BIRTHDAY.getDate():"");
            $("#Phone").val($.FxNull(ob.PHONE, ""));
            $("#REFEREE_CARD").val($.FxNull(ob.REFEREE_CARD, ""));
            $("#REFEREE").val($.FxNull(ob.REFEREE, ""));
            $("#ADDRESS").val($.FxNull(ob.ADDRESS, ""));
            $("#POSTAL_CODE").val($.FxNull(ob.POSTAL_CODE, ""));
            $("#EMAIL").val($.FxNull(ob.EMAIL, ""));
            $("#IS_LUNAR_CALENDAR").attr("checked",$.FxNull(ob.IS_LUNAR_CALENDAR, "") == "1");
            //$("#DISEASE").val($.FxNull(ob.DISEASE,""));
            if(disease && disease.length>0) {
                $(disease).each(function() {
                    var obj= $("#DISEASE").find(":checkbox[value='"+this.Code+"']");
                    if(obj.size()>0) obj.eq(0).attr("checked","checked");
                });
            }
            $("#REFEREE_CARD").attr("lst",$.FxNull(ob.REFEREE_CARD, "")).attr("state","1");
            $("#TITLE").val($.FxNull(ob.TITLE,""));
            $("#FAMILY").val($.FxNull(ob.FAMILY,""));

            var pro = $.FxNull(ob.AREA_CODE, "");
            if (pro.length == 6) {
                $("#province").val(pro.substr(0, 2) + "0000");
                $("#province").change();
                $("#city").attr("pvl", pro.substr(0, 4) + "00");
                $("#AREA_CODE").attr("pvl", pro);
            }

            $("#GIVE_POINTS").val($.FxNull(ob.GIVE_POINTS, "")).attr("disabled","disabled");
            $("#CONSUME_POINTS").val($.FxNull(ob.CONSUME_POINTS, "")).attr("disabled","disabled");
            $("#GROUP_KEY").val($.FxNull(ob.GROUP_KEY, ""));
            $("#PWD").val($.FxNull(ob.PWD, ""));
            $("#MEMO").val($.FxNull(ob.MEMO, ""));

            var t=tmpl("<tr ky=\"${ID}\" nm=\"${NAME}\" dt=\"${MEMORIALDAY_DATE}\"><td>${NAME}</td><td>${MEMORIALDAY_DATE}</td><td><a href=\"javascript:\" pk=\"${ID}\" onclick=\"delMem(this);\">删除</a></td></tr>",memoryDay);
            if (memoryDay && memoryDay.length > 0) $("#memTable>tbody").empty(); 
            $("#memTable>tbody").append($(t));
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div class="pop_logging_body">
            <table width="100%" class="common_table_noborde">
                <tr>
                    <td width="18%" align="right">顾客卡号：
                    </td>
                    <td>
                        <input id="CARD_NO" type="text" state="0" class="common_search_input w150" />
                    </td>
                    <td width="18%" align="right">
                        <span class="f12red">*</span>顾客级别：
                    </td>
                    <td>
                        <select id="LEVEL_CODE" class="common_search_select w150">
                            <option value="">请选择</option>
                            <%=CurstomerLevelOption%>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">
                        <span class="f12red">*</span>姓名：
                    </td>
                    <td>
                        <input id="NAME" type="text" class="common_search_input w150" />
                    </td>
                    <td width="18%" align="right">
                        <span class="f12red">*</span>手机号码：
                    </td>
                    <td>
                        <input id="MOBILE" type="text" state="0" class="common_search_input w150" />
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">身份证：
                    </td>
                    <td>
                        <input id="ID_CARD" type="text" class="common_search_input w150" />
                    </td>
                    <td width="18%" align="right">性别：
                    </td>
                    <td>
                        <select id="SEX" class="common_search_select w150">
                            <option value="1">男</option>
                            <option value="0">女</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">生日：
                    </td>
                    <td>
                        <input id="BIRTHDAY" type="text" onfocus="WdatePicker({startDate:'1980-1-1'})" class="common_search_input w150" /><input type="checkbox" id="IS_LUNAR_CALENDAR" />阴历
                    </td>
                    <td width="18%" align="right">固定电话：
                    </td>
                    <td>
                        <input id="Phone" type="text" class="common_search_input w150" />
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">职业：
                    </td>
                    <td>
                        <input id="TITLE" type="text" class="common_search_input w150" />
                    </td>
                    <td width="18%" align="right">家庭情况：
                    </td>
                    <td>
                        <input id="FAMILY" type="text" class="common_search_input w150" />
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">推荐人卡号：
                    </td>
                    <td>
                        <input id="REFEREE_CARD" type="text" state="0" lst="" class="common_search_input w150" />
                    </td>
                    <td width="18%" align="right">推荐人姓名：
                    </td>
                    <td>
                        <input id="REFEREE" type="text" class="common_search_input w150" />
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">所在省：
                    </td>
                    <td colspan="3">
                        <select id="province" class="common_search_select w100">
                            <option value="">请选择</option>
                            <%=Province%>
                        </select>市
                    <select id="city" disabled="disabled" class="common_search_select w100">
                        <option value="">请选择</option>
                    </select>
                        区
                    <select id="AREA_CODE" disabled="disabled" class="common_search_select w100">
                        <option value="">请选择</option>
                    </select>
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">地址：
                    </td>
                    <td colspan="3">
                        <input id="ADDRESS" type="text" class="longtxt" style="width: 475px;" />
                    </td>
                </tr>
                <tr>
                    <td align="right">顾客自述病史：
                    </td>
                    <td id="DISEASE" colspan="3" class="checkboxList">
                        <%=Disease %>
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">邮编：
                    </td>
                    <td>
                        <input id="POSTAL_CODE" type="text" class="common_search_input w150" maxlength="6" />
                    </td>
                    <td width="18%" align="right">电子邮件：
                    </td>
                    <td>
                        <input id="EMAIL" type="text" class="common_search_input w150" />
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">体验积分：
                    </td>
                    <td>
                        <input id="GIVE_POINTS" type="text" value="0" class="common_search_input w150" />
                    </td>
                    <td width="18%" align="right">消费积分：
                    </td>
                    <td>
                        <input id="CONSUME_POINTS" type="text" value="0" class="common_search_input w150" />
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">顾客分组：
                    </td>
                    <td>
                        <select id="GROUP_KEY" class="common_search_select w150">
                            <option value="">请选择</option>
                            <%=CurstomerGroupOptions%>
                        </select>
                    </td>
                    <td width="18%" align="right">顾客密码：
                    </td>
                    <td>
                        <input id="PWD" type="text" class="common_search_input w150" />
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right">备注：
                    </td>
                    <td colspan="3">
                        <input id="MEMO" type="text" class="common_search_input w450" />
                    </td>
                </tr>
                <tr>
                    <td width="18%" align="right" valign="top">纪念日：
                    </td>
                    <td colspan="3">
                        <table id="memTable" class="common_table" style="width: 400px; height: 42px;">
                            <thead>
                                <tr>
                                    <th>纪念日名称
                                    </th>
                                    <th>纪念日时间
                                    </th>
                                    <th>操作
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td colspan="3">没有数据</td>
                                </tr>
                            </tbody>
                        </table>
                        <input type="text" id="MEMDAY_NAME" class="common_search_input w150" />
                        <input type="text" id="MEMDAY_DATE" onfocus="WdatePicker({startDate:'1980-1-1'})" class="common_search_input w150" />
                        <input type="button" id="memAdd" value="" class="common_btn_add" />
                    </td>
                </tr>
                 <tr>
                    <td width="18%" align="right">上传照片
                    </td>
                    <td colspan="3">
                          <asp:FileUpload ID="FileUpload1" runat="server" />
                          <asp:Button ID="BtnUpload" runat="server" Text="上传" onclick="BtnUpload_Click" />
                          <span style="color:Red">&nbsp; 备注：1上传照片成功后还需点"保存按钮"将照片保存到数据库中;2上传照片格式：gif 、jpg 、jpeg 、 png</span>
                          <asp:HiddenField ID="FILE_PATH" runat="server" /><br />
                          <asp:Label ID="LblFile_path" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
            </table>
            <div class="pop_btn" style="margin-top: 8px;">
                <input id="btnAdd" type="button" value="" class="common_btn_save mr30 mb25" />
                <input id="btnClose" type="button" value="" class="common_btn_remove mb25" onclick="top.tipsWindown.close();" />
            </div>
        </div>
    </form>
</body>
</html>
